﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShareIt_MVC3.Models;

namespace ShareIt_MVC3.Tests
{
    abstract class Utilities
    {
        public static void EmptyDB()
        {

            // zuerst alle lendings löschen
            LendingCollection lendColl = new LendingCollection();
            var Lendings = lendColl.GetAllLendings();

            foreach (var Lending in Lendings)
                lendColl.DeleteLending(Lending);


            // dann alle resources
            ResourceCollection resColl = new ResourceCollection();
            var resources = resColl.GetAllResources();

            foreach (var resource in resources)
                resColl.DeleteResource(resource);


            // zuletzt die user
            UserCollection userColl = new UserCollection();
            var users = userColl.GetAllUsers();

            foreach(var user in users)
                userColl.DeleteUser(user);

        }
    }
}
